import abc
from common.variables import TimeFrameType
import pandas as pd


class FactorBase:
    preloads: int
    bfname: str
    fname_list: list[str] = []
    depend_fnames: list[str]  # depends some fnames

    @abc.abstractmethod
    def calculate(
        self,
        symbol: str,
        timeframe: TimeFrameType,
        start: str,
        end: str,
        callbacks: list[callable],
    ) -> pd.DataFrame:
        pass

    @property
    def basename(self):
        return self.__class__.__name__
